﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _4___RC4Encryption
{
    class Program
    {


        static void Main(string[] args)
        {
            string text;
            StreamReader reader = new StreamReader(File.Open("file.bin", FileMode.Open));
            using (reader)
            {
                text = reader.ReadToEnd();
            }
            RC4 encryptor = new RC4("parola");
            text = encryptor.EnDeCrypt(text);
            Console.WriteLine(text);

            StreamWriter writer = new StreamWriter("outputFile.bin");
            using (writer)
            {
                writer.Write(text);
            }

            text = encryptor.EnDeCrypt(text);
            Console.WriteLine(text);
        }
    }
}
